package com.rub.android.jetpack

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import com.rub.android.R
import com.rub.android.databinding.ActivityDataBinding1Binding
import com.rub.android.jetpack.viewmodel.UserViewModel

class DataBinding1Activity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        //ActivityDataBinding1Binding是databinding控件自动生成的一个类，根据布局名称+Binding生成
        var activityDataBinding =DataBindingUtil.setContentView(this, R.layout.activity_data_binding1) as ActivityDataBinding1Binding

        activityDataBinding.userUserModel= UserViewModel()

    }
}